% a demo for parse GPS raw data.
filename = 'dgpsdata.txt';
f= fopen(filename,'r');
while(true)
    strline = fgets(f);
%     disp(strline)
    if(strline==-1)
        break;
    end
    %$GPYBM,SN02601403,095738.60,+34.024705319,+113.715322469,58.865,30.312,0.000,0.043,0.025,0.008,0.050,3784270.794,-80878.219,,,1,1,18,200,,0.000,0,*46
    data=sscanf(strline,'$GPYBM,SN%d,%f,%f,%f,%f');
    if(isempty(data)==false)
%         disp(data(3:end));
        p=lla2ecef(data(3:end)');
        disp(p);
    end
end